package com.gentle.service.impl;

import com.gentle.annotation.LockAnnotation;
import com.gentle.service.ZookeeperLockService;
import org.apache.curator.framework.CuratorFramework;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;



/**
 * @author Gentle
 * @date 2019/05/29 : 23:57
 */
@Service
public class ZookeeperLockServiceImpl implements ZookeeperLockService {

    @Autowired
    CuratorFramework curatorFramework;
    /**
     * 计数
     */
    int a =0;

    /**
     * 计数业务
     * @return false
     */
    @Override
    @LockAnnotation
    public Boolean lockAcquireTimeOut() {
        System.out.println(a++);
        return false;
    }

}
